#include "svn_access.h"

int main(int argc, char *argv[])
{
	if (argc < 4)
	{
		printf("subversion author contribution lines calculator, version 0.1\n\n");
		printf("svncount.exe <svn executeble full path> <source directory> <output file>\n");
		printf("example: svncount.exe d:\\svn\\svn.exe d:\\src_dir d:\\svncount.txt\n");
		return 0;
	}
	svn_stat stat;
	std::list<std::string> listFilter;
	listFilter.push_back("cpp");
	listFilter.push_back("c");
	listFilter.push_back("h");
	listFilter.push_back("rc");
	listFilter.push_back("php");
	listFilter.push_back("js");
	stat.set_filter(listFilter);

	stat.set_svn_execute(argv[1]);
	stat.begin(argv[2]);
	std::string output = stat.output();
	
	printf("%s\n", output.c_str());
	FILE *fp = fopen(argv[3], "wb");
	if (fp)
	{
		fwrite(output.c_str(), output.size(), 1, fp);
		fclose(fp);
	}

	return 0;
}